import java.awt.AWTEvent;
import java.awt.Frame;
import java.awt.event.WindowEvent;

public class MyFrame extends Frame {

	public static void main(String args[]) {
		new MyFrame();

	}

	MyFrame() {
		enableEvents(AWTEvent.WINDOW_EVENT_MASK);
		setLocation(250, 250);
		MyCanvas canvas = new MyCanvas();
		add(canvas);
		pack();
		show();
		setTitle("weak stuff");
		// setSize(500,400);

	}

	public void processWindowEvent(WindowEvent event) {
		if (event.getID() == WindowEvent.WINDOW_CLOSING)
			System.exit(0);
		if (event.getID() == WindowEvent.WINDOW_OPENED)
			System.out.println("Opened");

	}

}